<template>
    <div class="ininfo">
        <ininfo-header></ininfo-header>
        <qiang-info></qiang-info>
        <second-info></second-info>
        
        </div>
</template>

<script>
import IninfoHeader from './components/IninfoHeader.vue'
import QiangInfo from './components/QiangInfo.vue'
import SecondInfo from './components/SecondInfo.vue'
import axios from 'axios'

export default {
    name:'ininfo',
    components:{
        IninfoHeader,
        QiangInfo,
        SecondInfo
    },
     data: function(){
    return{
      iconList: [],
      recommendList: []
    }
  },
  mounted(){
    this.getHomeApiInfo()
  },
  methods: {
    getHomeApiInfo(){
      axios.get("/mock/home.json").then(this.getHomeResponseInfo)
    },
    getHomeResponseInfo(response){
      //  console.log(response.data);
      let res = response.data  //就是home.json里面的内容
      if(res.success && res.dataList){
        const data = res.dataList //取json中的datalist属性
        // console.log(data.iconLists.length)
        this.iconList = data.iconLists
        this.recommendList = data.recommendLists
      }
    }
  }
}
</script>

